import request from '/@/utils/request';
import { BaseResponse } from '/@/interfaces/BaseModel';
import { StatisticsApi } from '/@/enums/jdfsystem-api-enum';
import { useUrlUtil } from '/@/utils/urlUtil';
import {
    StatisticsCountModel,
    StatisticsFileModel,
} from '/@/interfaces/JdfsystemModel';

function useStatisticsApi() {
    return {
        count: function() {
            return request.get<BaseResponse<StatisticsCountModel>>(StatisticsApi.COUNT);
        },
        fileCount:function(days: number) {
            const urlUtil = useUrlUtil();
            return request.get<BaseResponse<StatisticsFileModel>>(urlUtil.joinParam(StatisticsApi.FILE_COUNT, {days: days}));
        },
    }
}

export default useStatisticsApi;